<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <title>积分兑换商城</title>
    <link rel="stylesheet" type="text/css" href="/shop/css/base.css"/>
    <link rel="stylesheet" type="text/css" href="/shop/css/index.css"/>
    <link rel="stylesheet" type="text/css" href="/shop/css/mui.min.css"/>
    <link rel="stylesheet" type="text/css" href="/shop/css/loaders.min.css"/>
    <link rel="stylesheet" type="text/css" href="/shop/css/loading.css"/>
    <link rel="stylesheet" href="/shop/css/swiper.min.css">
    <script src="/shop/js/jquery.min.js" type="text/javascript"></script>
    <script src="/js/plugins/jrender/jrender.min.js"></script>
    <script src="/shop/js/rem.js" type="text/javascript"></script>
    <script src="/shop/js/others.js" type="text/javascript"></script>
    <script src="/shop/js/swiper.jquery.min.js" type="text/javascript"></script>

    <script>
        $(window).load(function () {
            $(".loading").addClass("loader-chanage");
            $(".loading").fadeOut(300);
        });

        $(function () {
            var user = JSON.parse(sessionStorage.getItem("user"));
            console.log(user);


            //精品服饰
            $.get("/products", {type: 1, pageSize: 3}, function (data) {
                $("#p1").renderValues(data, {
                    getHref: function (item, value) {
                        $(item).attr("href", $(item).data("url") + value);
                    }
                });
            });
            //家电
            $.get("/products", {type: 2, pageSize: 3}, function (data) {
                $("#p2").renderValues(data, {
                    getHref: function (item, value) {
                        $(item).attr("href", $(item).data("url") + value);
                    }
                });
            });
            //电子数码
            $.get("/products", {type: 3, pageSize: 3}, function (data) {
                $("#p3").renderValues(data, {
                    getHref: function (item, value) {
                        $(item).attr("href", $(item).data("url") + value);
                    }
                });
            });
            //零食
            $.get("/products", {type: 4, pageSize: 3}, function (data) {
                $("#p4").renderValues(data, {
                    getHref: function (item, value) {
                        $(item).attr("href", $(item).data("url") + value);
                    }
                });
            })
        })
    </script>
</head>
<!--loading页开始-->
<div class="loading">
    <div class="loader">
        <div class="loader-inner pacman">
            <div></div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
        </div>
    </div>
</div>
<!--loading页结束-->
<body>
<!--头部区域-->
<header class="mui-bar mui-bar-nav" id="header">
    <a href="/index.html">
        <i class="iconfont icon-fanhui"></i>
    </a>
    <h4>积分商城</h4>
</header>
<div id="main" class="clearfloat warp">
    <div class="mui-content">
        <!--banner开始-->
        <div class="banner swiper-container">
            <div class="swiper-wrapper">
                <div class="swiper-slide">
                    <a href="javascript:void(0)">
                        <img class="swiper-lazy" data src="/shop/images/banner4.jpg" alt="">
                    </a>
                </div>
                <div class="swiper-slide">
                    <a href="javascript:void(0)">
                        <img class="swiper-lazy" data src="/shop/images/banner1.jpg" alt="">
                    </a>
                </div>
                <div class="swiper-slide">
                    <a href="javascript:void(0)">
                        <img class="swiper-lazy" data src="/shop/images/banner3.jpg" alt="">
                    </a>
                </div>
            </div>
        </div>

        <!--1F精品服饰-->
        <div class="theme clearfloat" id="p1">
            <div class="boutit clearfloat">
                <span></span>
                <samp>1F精品服饰</samp>
            </div>
            <div class="content clearfloat" render-loop="list">
                <div class="list clearfloat fl">
                    <a data-url="/shop/detail.html?id=" render-key="list.id" render-fun="getHref">
                        <div class="tu clearfloat fr">
                            <span></span>
                            <img render-src="list.productImg"/>
                        </div>
                        <div class="shang clearfloat fl box-s">
                            <p class="tit over" render-html="list.productName"></p>
                            <p><span>积分:</span><span class="over db red" render-html="list.productPrice"></span></p>
                        </div>
                    </a>
                </div>
            </div>
        </div>
        <!--2F家电-->
        <div class="theme clearfloat" id="p2">
            <div class="boutit clearfloat">
                <span></span>
                <samp>2F家电</samp>
            </div>
            <div class="content clearfloat" render-loop="list">
                <div class="list clearfloat fl">
                    <a data-url="/shop/detail.html?id=" render-key="list.id" render-fun="getHref">
                        <div class="tu clearfloat fr">
                            <span></span>
                            <img render-src="list.productImg"/>
                        </div>
                        <div class="shang clearfloat fl box-s">
                            <p class="tit over" render-html="list.productName"></p>
                            <p><span>积分:</span><span class="over db red" render-html="list.productPrice"></span></p>
                        </div>
                    </a>
                </div>
            </div>
        </div>
        <!--3F电子数码-->
        <div class="theme clearfloat" id="p3">
            <div class="boutit clearfloat">
                <span></span>
                <samp>3F电子数码</samp>
            </div>
            <div class="content clearfloat" render-loop="list">
                <div class="list clearfloat fl">
                    <a data-url="/shop/detail.html?id=" render-key="list.id" render-fun="getHref">
                        <div class="tu clearfloat fr">
                            <span></span>
                            <img render-src="list.productImg"/>
                        </div>
                        <div class="shang clearfloat fl box-s">
                            <p class="tit over" render-html="list.productName"></p>
                            <p><span>积分:</span><span class="over db red" render-html="list.productPrice"></span></p>
                        </div>
                    </a>
                </div>
            </div>
        </div>
        <!--4F零食-->
        <div class="theme clearfloat" id="p4">
            <div class="boutit clearfloat">
                <span></span>
                <samp>4F零食</samp>
            </div>
            <div class="content clearfloat" render-loop="list">
                <div class="list clearfloat fl">
                    <a data-url="/shop/detail.html?id=" render-key="list.id" render-fun="getHref">
                        <div class="tu clearfloat fr">
                            <span></span>
                            <img render-src="list.productImg"/>
                        </div>
                        <div class="shang clearfloat fl box-s">
                            <p class="tit over" render-html="list.productName"></p>
                            <p><span>积分:</span><span class="over db red" render-html="list.productPrice"></span></p>
                        </div>
                    </a>
                </div>
            </div>
        </div>
    </div>
</div>
<!--footer star-->
<footer class="page-footer fixed-footer" id="footer">
    <ul>
        <li class="active">
            <a href="/shop/shop.html">
                <i class="iconfont icon-shouye"></i>
                <p>首页</p>
            </a>
        </li>
        <li>
            <a href="/shop/cation.html">
                <i class="iconfont icon-icon04"></i>
                <p>分类</p>
            </a>
        </li>
        <li>
            <a href="/shop/shopcar.html">
                <i class="iconfont icon-gouwuche"></i>
                <p>购物车</p>
            </a>
        </li>
        <li>
            <a href="/shop/center.html">
                <i class="iconfont icon-yonghuming"></i>
                <p>我的</p>
            </a>
        </li>
    </ul>
</footer>
<!--footer end-->
</body>
</html>